<template>
  <a-modal :visible="show" title="项目终止" centered destroyOnClose @ok="handleOk"
           @cancel="handleCancel" :confirmLoading="loading"
           :bodyStyle="{'padding':'10px 20px'}">
    <a-form class="custom-form" :form="closeForm" :label-col="{span:4}" :wrapper-col="{span:20}">
      <a-form-item label="终止原因">
        <a-textarea :rows="5" :maxLength="100" placeholder="请输入终止原因"
                    v-decorator="['closeReason',{rules:[{required:true,message:'请输入终止原因'}]}]"></a-textarea>
      </a-form-item>
    </a-form>
  </a-modal>
</template>

<script>
export default {
  name: "NegotiateClose",
  props: {
    show: false,
    loading: false,
    data: {}
  },
  data() {
    return {
      closeForm: this.$form.createForm(this, {name: 'closeForm'}),
    }
  },
  methods: {
    handleOk() {
      this.closeForm.validateFields((error, values) => {
        if (!error) {
          this.$emit('ok', {...values})
        }
      })
    },
    handleCancel() {
      this.$emit('cancel')
    }
  }
}
</script>

<style scoped lang="scss">
.custom-form {
  > > > .ant-form-item {
    margin-bottom: 0;
  }
}
</style>
